package com.zh.demo.eurekaserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Date;

@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {



    public static void main(String[] args) {

        System.out.println(new Date()+"  ===> application eurekaServer start ...");

        ConfigurableApplicationContext context = SpringApplication.run(EurekaServerApplication.class, args);

        String server_port = context.getEnvironment().getProperty("server.port");
        String server_host = context.getEnvironment().getProperty("server.host");

        System.out.println(new Date()+"  ===> application eurekaServer server host:port: "+server_host+":"+server_port);

        System.out.println(new Date()+"  ===> application eurekaServer start success");
    }

}

